public class man_num {
    //李艺
    public static void main(String[] args){
        int[] arr = {1,2,3,9,4,3,7,8,2,1};
        for(int i = 0;i<arr.length-1;i++) {
            if (arr[i] > arr[i + 1]) {
                int c;
                c = arr[i];
                arr[i] = arr[i + 1];
                arr[i + 1] = c;
            }
        }
        System.out.println("最大值为："+arr[arr.length-1]);

        int max_num = arr[0];
        for(int i = 1;i<arr.length;i++){
            if (max_num > arr[i]) {
                max_num = arr[i];
            }
        }
        System.out.println("最小值为："+max_num);
    }
}
